"""
面试题:
如何操作弹出框对象?  弹出框--->不能通过F12进行定位
1. 创建弹出框对象  driver.switch_to.alert
2.调用弹出框方法
"""
# 1. 先创建浏览器驱动对象
import time

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select

driver=webdriver.Chrome()
driver.maximize_window()
# 2 通过get方法打开页面
# driver.get("http://localhost:8081/regA.html")
driver.get("http://localhost:82/index.php/Home/user/login.html")
#
# driver.find_element(By.CSS_SELECTOR,"#confirma").click()
driver.find_element(By.CSS_SELECTOR,"a[name='sbtbutton']").click()

time.sleep(5)
driver.find_element(By.CSS_SELECTOR,".layui-layer-btn0").click()
# #1.创建弹出框对象
# alert=driver.switch_to.alert
# time.sleep(3)
# # alert.accept()    #点击确定
# alert.dismiss()




time.sleep(100)

# 4. 关闭浏览器驱动对象
driver.quit()
